#ifndef SPECIALTABLEMODEL_H
#define SPECIALTABLEMODEL_H


#include <campaign.h>
#include <specialability.h>
#include <characterclass.h>


#include <QAbstractTableModel>
#include <QPointer>


class SpecialTableModel : public QAbstractTableModel
{
    Q_OBJECT

public:

    enum Role
    {
        Role_FIRST = Qt::UserRole + 1,

        Role_CharacterClass = Role_FIRST,

        Role_LAST = Role_CharacterClass
    };

    explicit SpecialTableModel(QObject *parent = 0);

    void setCampaign(Campaign* campaign);

    virtual int rowCount(const QModelIndex &parent) const;
    virtual int columnCount(const QModelIndex &parent) const;

    virtual QVariant data(const QModelIndex &index, int role) const;
    virtual bool setData(const QModelIndex &index, const QVariant &value, int role);
    virtual QVariant headerData(int section, Qt::Orientation orientation, int role) const;

    virtual Qt::ItemFlags flags(const QModelIndex &index) const;

    bool ready() const;


public slots:

    virtual void revert();


private:

    QPointer<Campaign> m_campaign;
    QPointer<SpecialAbilities> m_specialAbilities;
    QPointer<CharacterClasses> m_characterClasses;

};

#endif // SPECIALTABLEMODEL_H
